package com.marvels.approve.loan.service;

import java.util.List;

import org.springframework.web.bind.annotation.RequestBody;

import com.marvels.approve.loan.dto.McamAcLoanApplyBdInfo;
import com.marvels.approve.loan.dto.McamAcLoanApplyImageInfo;
import com.marvels.approve.loan.dto.McamLoanApplyInfoDTO;
import com.marvels.approve.mqueues.dto.LoanApplyQueueDTO;
import com.marvels.common.exception.MarvelsBusinessException;

/**进件申请服务
 * @author 何杰
 * 2018年4月19日
 */
public interface IMcamLoanApplyInfoService {
	/***
	 * 保存映像数据
	 * @param apply
	 * @return
	 * @throws MarvelsBusinessException
	 */
	public Integer saveMcamAttachmentInfo(McamAcLoanApplyImageInfo apply)throws MarvelsBusinessException;
	/**
	 * 保存保单数据
	 * @param apply
	 * @return
	 * @throws MarvelsBusinessException
	 */
	public Integer saveMcamPolicyInfo(McamAcLoanApplyBdInfo apply)throws MarvelsBusinessException;
	/**保存从MQ中拿下来的进件数据
	 * @author 何杰
	 * 2018年4月21日
	 * @param apply
	 * @return
	 * @throws MarvelsBusinessException
	 */
	public Integer saveMcamLoanApplyInfo(McamLoanApplyInfoDTO apply)throws MarvelsBusinessException;
	/**通过loanid保存
	 * @author 何杰
	 * 2018年4月21日
	 * @param apply
	 * @return
	 * @throws MarvelsBusinessException
	 */
	public Integer updateMcamLoanApplyInfoByLoanId(McamLoanApplyInfoDTO apply)throws MarvelsBusinessException;
	/**条件查询
	 * @author 何杰
	 * 2018年4月19日
	 * @param dto
	 * @return
	 * @throws MarvelsBusinessException
	 */
	public List<McamLoanApplyInfoDTO> findLoanApplys(McamLoanApplyInfoDTO dto)throws MarvelsBusinessException;
	
	/**通过loanId查询
	 * @author 何杰
	 * 2018年5月14日
	 * @param loanId
	 * @return
	 * @throws MarvelsBusinessException
	 */
	public McamLoanApplyInfoDTO findMcamLoanApplyInfo(String loanId)throws MarvelsBusinessException;

	/**通过loanId 执行决策
	 * @author 何杰
	 * 2018年4月19日
	 * @return
	 * @throws MarvelsBusinessException
	 */
	public boolean executeDecision(String loanId)throws MarvelsBusinessException;
	
	/**通过预处理数据同步进件数据以及跑决策（进件详情queue同步跟踪）
	 * @param loanApplyQueue
	 * @return
	 * @throws MarvelsBusinessException
	 */
	public boolean initProcessData(LoanApplyQueueDTO loanApplyQueue)throws MarvelsBusinessException;
	
	/**退回补件
	 * @param dto
	 * @throws MarvelsBusinessException
	 */
	public void loanFallback(@RequestBody McamLoanApplyInfoDTO dto)throws MarvelsBusinessException;
}
